<?php 
$target = "movieimg/"; 
$target = $target . basename( $_FILES['uploaded']['name']) ; 
$ok=1;
if (!($uploaded_type=="image/jpeg")) {
echo "You may only upload JPEG files.<br>";
$ok=0;
} 
if ($ok==0) 
{ 
Echo "Sorry your file was not uploaded"; 
} 
else(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} 
else {
echo "Sorry, there was a problem uploading your file.";
}

//this goes in the webpage:
/*<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
*/
?> 
<input type="submit" src="ERD_2.JPG" />